package com.yjd.bi.jf.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yjd.bi.jf.dao.IJfOrderDetailProductSnapshotDao;
import com.yjd.bi.jf.model.JfOrderDetailProductSnapshotModel;
import com.yjd.bi.jf.service.IJfOrderDetailProductSnapshotService;
import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;

/**
 * <b>description</b>：会员年积分订单明细快照表业务实现<br>
 * <b>time</b>：2017-03-07 15:17:05 <br>
 * <b>author</b>：  ready percy-chen@hotmail.com
 */
@Service("jfOrderDetailProductSnapshotService")
public class JfOrderDetailProductSnapshotServiceImpl extends BaseServiceImpl implements IJfOrderDetailProductSnapshotService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public JfOrderDetailProductSnapshotModel insert(JfOrderDetailProductSnapshotModel model) throws Exception {
		return this.jfOrderDetailProductSnapshotDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(JfOrderDetailProductSnapshotModel model) throws Exception {
		return this.jfOrderDetailProductSnapshotDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param order_detail_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long order_detail_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("order_detail_id", order_detail_id);
		return this.jfOrderDetailProductSnapshotDao.deleteModel(paramMap, true);
	}

	@Resource
	private IJfOrderDetailProductSnapshotDao jfOrderDetailProductSnapshotDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.jfOrderDetailProductSnapshotDao;
	}

}
